1. Field of the Invention
The present invention relates to an image processing device which binarizes multi-level image data by using a least average error scheme or an error diffusion scheme.
2. Description of the Related Art
When there is a need to output multi-level image data via a printer device only capable of outputting binary data or when the amount of data needs to be reduced for the sake of a storage-capacity reduction or a transfer-speed enhancement, a binarizing process is performed to decrease the number of gray levels associated with each pixel. There are various schemes to achieve such a binarizing process. Among these, an error diffusion scheme and a least average error scheme are widely used since these schemes permit a high image resolution and a continuous gray-level control.
In recent years, an increasing number of inkjet printers have been manufactured as an item suitable for a personal use. These inkjet printers usually employ either one of these two schemes described above as a binarizing process.
The error diffusion scheme uses a quantization error generated during a process of binarizing a given pixel, and distributes the quantization error to surrounding pixels which are not yet subjected to a binarizing process. The distribution of the quantization error is performed by attaching respective weights. The least average error scheme corrects an image-data value of a given pixel by using a weighted average of quantization errors generated at surrounding pixels when the surrounding pixels are binarized. The error diffusion scheme and the least average error scheme are logically equivalent to each other, the only difference being a timing as to when an error diffusion process is performed.
As a publicly known example of the error diffusion scheme and the least average error scheme, Japanese Patent Laid-open Application No. 7-226841 may be referred to. In general, the least average error scheme corrects a multi-level-image-data value of a given pixel by adding weighted errors of surrounding pixels which are already binarized, and, then, binarizes the corrected value by using a predetermined threshold value. An error generated during this binarizing process is to be spread to surrounding pixels which are not yet binarized. First, a method of obtaining an error for a given pixel will be described.
For the sake of explanation, a main scan in the present invention runs from the left to the right in the image, and a sub-scan runs from the top to the bottom. FIG. 4 is an illustrative drawing showing an example of a weight matrix.
A symbol "*" in FIG. 4 indicates a current pixel. Errors obtained from binarized pixels are multiplied by respective weights of the matrix, and a total of the errors is calculated with respect to the surrounding binarized pixels. Then, the total is divided by a sum of all the matrix weights. In this manner, an error to be used for correcting an image value of the current pixel is obtained by standardizing the errors of the surrounding binarized pixels.
What is described above can be represented by the following equation. EQU Dxy=dxy+.SIGMA.((ex+i,y+j.multidot.wi,j)/.SIGMA.wi,j)
Here, x and y are coordinates of the current pixel, and i and j are coordinates with reference to the weight matrix (i and j are 0 and 0 for the current pixel, and are negative with respect to any positions on the left or the top of the current pixel). Further, the following gives a description of the rest of the symbols used in the above equation.
dxy: image data of the current pixel PA1 ex+i,y+j: error of a surrounding pixel PA1 wij: a weight of the weight matrix PA1 Dxy: corrected data PA1 Next, a method of binarizing the corrected data will be described. In the binarizing method, the corrected image data Dxy is binarized by using a predetermined threshold value T. When Dxy is smaller than T, an output is 0, and when Dxy is greater or equal to T, the output is 1. Here, the output takes a value of 1 when Dxy is equal to T. Even if the output is set to 0 for Dxy equal to T, however, no significant difference is observed in the output image. PA1 IF Dxy&lt;T PA1 THEN Oxy=0 PA1 ELSE Oxy=1,
What is described above can be represented as follows:
where T is a threshold value, and Oxy is output binary data.
Finally, a method of obtaining an error of the current pixel will be described. This method calculates an error of the current pixel based on the corrected data Dxy and the output data Oxy. In general, when Oxy is zero, Dxy per se is treated as the error. When Oxy is 1, Dxy minus a maximum value of the input image data is treated as the error. This is represented as follows: EQU exy=Dxy-Oxy.multidot.dmax,
where dmax is a maximum value among the input image data.
According to the theory of the binarizing, a binarizing process can be achieved by the above-described methods such that level information of the entire image is preserved between the input image and the output image.
As described above, the least average error scheme and the error diffusion scheme have excellent characteristics as a binarizing process. As is described in Japanese Patent Laid-open Application No. 7-226841, however, when density of dots generated by the binarizing process is sparse, dots are not evenly distributed, so that unevenly connected dots are generated to cause image degradation. An artifact generated in such a manner is generally called a worm.
There are two different cases in which dots are sparse. One is when the an optical level of the image is low, and the other is when the optical level of the image is high. When the image data is represented by 8 bits with the whitest level being 0and the blackest level being 255, for example, an image portion having a value thereof close to zero is a portion where the level is low (no dot is printed for a pixel having a value of zero). When the least average error scheme or the error diffusion scheme is applied to this image portion, the resulting image portion ends up having black dots scarcely scattered.
An image portion having a value thereof close to 255 is a portion where the level is high (a potion having a value of 255 is completely darkened in black). Such a portion ends up having white holes sparsely scattered against the black background. White holes are generally not referred to as white dots. In the output image, however, they look like white dots printed against a black background. In such a portion, worms as previously described are observed. In ordinary inkjet printers, white holes do not appear where the image level is high. This is because a size of a dot is relatively large in comparison to the image resolution of the printer, and, also, because ink tends to be spread and becomes blurry. In inkjet printers, thus, the problem as described above is not generally observed.
FIG. 5 is an illustrative drawing showing an example of an output image obtained by applying the least average error scheme or the error diffusion scheme to an image portion where the image level is low.
Japanese Patent Laid-open Application No. 7-226841 attends to this problem by enlarging a size of the weight matrix (which is referred to as an error-diffusion matrix in this document). An experiment conducted by the inventor of the present invention showed, however, that worms were not completely eliminated even though an enlargement of the weight matrix size had some improving effect.
Even when a larger size weight matrix is used only for part of the image, hardware implementation of the least average error scheme or the error diffusion scheme leads to a cost increase because of a need for a larger memory volume for storing errors.
Accordingly, there is a need for an image processing device which can attain an improved image quality when multi-level image data is binarized by the least average error scheme or the error diffusion scheme.
There is another need for an image processing device which can attain improved image quality by use of a simple device structure in which correction of an error value is made by subtracting a predetermined value from the error value with the corrected value being switched depending on the input multi-level data.
There is still another need for an image processing device which can attain an improved image quality and preserve a continuity of image levels by enhancing a dot spreading effect, which is achieved by making stronger correction (increasing the extent to which the errors are lowered in the entirety of image) as the input multi-level data approaches closer to the lowest level so as to have a stronger effect on a highlight portion where worms would be conspicuous.
There is yet another need for an image processing device which can attain an improved image quality by changing the number of corrected pixels.
There is further another need for an image processing device which can attain an improved image quality by enhancing a dot spreading effect, which is achieved by making stronger correction (increasing the extent to which the errors are lowered in the entirety of image) as the input multi-level data approaches closer to the lowest level so as to have a stronger effect on a highlight portion where worms would be conspicuous.
There is still another need for an image processing device which can change not only the number of corrected pixels but also the correction values, so that the amount of computation is decreased to enhance the processing speed.